home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1998 June / Macworld (1998-06).dmg / Shareware World / Utilities / Video / MooVer 1.6-us / Example / ATorusLine.POV next >
Text File  |  1997-10-06  |  5KB  |  255 lines

  1. // Persistence of Vision Ray Tracer Scene Description File
  2. // File: A Torus Line.pov
  3. // Vers: 3
  4. // Desc: Simple POV-Ray scene file for MooVer 1.5
  5. // Date: 10/1/97
  6. // Auth: Eduard Schwan
  7. //
  8.  
  9. #version 3
  10.  
  11. #include "colors.inc"
  12.  
  13. // ----------------------------------------
  14. // Animation
  15. // ----------------------------------------
  16.  
  17. #declare MyClock = (clock*2)-1
  18.  
  19. // ----------------------------------------
  20. // Lights, Camera, Firmament
  21. // ----------------------------------------
  22.  
  23. global_settings
  24. {
  25.   assumed_gamma 1.0
  26. }
  27.  
  28. camera
  29. {
  30.   location  <6.0, 7.0, -7.0>
  31.   direction 1*z
  32.   right     2*x
  33.   look_at   <0.0, 0.0,  0.0>
  34. }
  35.  
  36. sky_sphere
  37. {
  38.   pigment
  39.   {
  40.     gradient y
  41.     color_map
  42.     {
  43.      [0.0 color rgb <0.3,0.5,0.8>]
  44.      [0.5 color rgb <0.0,0.1,0.3>]
  45.      [0.9 color rgb 0.0]
  46.     }
  47.   }
  48. }
  49.  
  50. light_source
  51. {
  52.   0*x // light's position (translated below)
  53.   color red 1.0  green 1.0  blue 1.0  // light's color
  54.   translate <-30, 30, -30>
  55. }
  56.  
  57. // ----------------------------------------
  58. // Gunbarrel declaration
  59. // ----------------------------------------
  60.  
  61. #declare GunBarrelTexture =
  62. texture
  63. {
  64.   pigment
  65.    { radial frequency 10
  66.      color_map
  67.       { [0.69 rgbf 1] [0.70 rgb <0.0,0.1,0.0>] }
  68.    }
  69.   finish  { refraction 1 ior 1.2 reflection 0.2 specular 0.7 roughness 0.1 }
  70. }
  71.  
  72. #declare GunBarrelShape =
  73. union
  74. {
  75.   cylinder { 0*y, 10*y, 0.5 open }
  76.   torus {1, 0.5 clipped_by { cylinder { 0*y, -1*y, 1 open } } }
  77.   translate 0.5*y
  78.   scale <1,3,1>
  79. }
  80.  
  81. // ----------------------------------------
  82. // Bullet declaration
  83. // ----------------------------------------
  84.  
  85. #declare BulletTexture =
  86. texture
  87. {
  88.   pigment { rgb <0.1,0.2,0.1> }
  89.   finish  { reflection 0.1 specular 0.5 roughness 0.1 }
  90. }
  91.  
  92. #declare BulletShape =
  93. union
  94. {
  95.   cylinder { 0*y, 0.5*y, 0.4 }
  96.   sphere { 0, 0.4 }
  97. }
  98.  
  99. // ----------------------------------------
  100. // Holed Donut declaration
  101. // ----------------------------------------
  102.  
  103. #declare DonutTexture =
  104. texture
  105. {
  106.   pigment { rgbf <1,0,0,0> }
  107.   finish { /*refraction 1 ior 1.2*/ reflection 0.2 specular 0.5 roughness 0.1 }
  108. }
  109.  
  110. #declare DonutHoleShape = // Donut with hole
  111. torus { 1.0, 0.5 }
  112.  
  113. // ----------------------------------------
  114. // Changing Donut declaration
  115. // ----------------------------------------
  116.  
  117. #if (MyClock < -0.1)
  118.   #declare MorphWidth = 0.5
  119. #else
  120.   #if (MyClock < 0.1)
  121.     #declare MorphWidth = (0.1-MyClock)
  122.   #else
  123.     #declare MorphWidth = 0.0
  124.   #end
  125. #end
  126. #declare DonutMorphShape = // Donut with partial plug
  127. merge
  128. {
  129.   object {DonutHoleShape}              // the donut
  130. #if (MorphWidth > 0)
  131.   cylinder {-MorphWidth*y, +MorphWidth*y, 1.0} // the plug
  132. #end
  133. }
  134.  
  135. // ----------------------------------------
  136. // Plugged Donut declaration
  137. // ----------------------------------------
  138.  
  139. #declare DonutPlugShape = // Donut with full plug
  140. merge
  141. {
  142.   object {DonutHoleShape}       // the donut
  143.   cylinder {-0.5*y, 0.5*y, 1.0} // the plug
  144. }
  145.  
  146. // ----------------------------------------
  147. // Gunbarrel & Catcher
  148. // ----------------------------------------
  149.  
  150. object
  151. {
  152.   GunBarrelShape
  153.   texture { GunBarrelTexture }
  154.   translate 3*y
  155.   rotate MyClock*36*y
  156. }
  157.  
  158. object
  159. {
  160.   GunBarrelShape
  161.   texture { GunBarrelTexture }
  162.   rotate 180*x
  163.   translate -4*y
  164.   rotate MyClock*36*y
  165. }
  166.  
  167. // ----------------------------------------
  168. // Balls
  169. // ----------------------------------------
  170.  
  171. object
  172. {
  173.   BulletShape
  174.   texture { BulletTexture }
  175.   translate -6*MyClock*y
  176. }
  177.  
  178. // ----------------------------------------
  179. // Main Donuts
  180. // ----------------------------------------
  181.  
  182. #declare Spacing = 4
  183.  
  184. // plugged donuts
  185. #declare Count = 16
  186. #while (Count > 0)
  187. object
  188. {
  189.   DonutPlugShape
  190.   texture { DonutTexture }
  191.   translate -Count*Spacing*x
  192.   translate MyClock*Spacing*x/2
  193. }
  194. #declare Count = Count-1
  195. #end
  196.  
  197. // morphing donut
  198. object
  199. {
  200.   DonutMorphShape
  201.   texture { DonutTexture }
  202.   translate +0*x
  203.   translate MyClock*Spacing*x/2
  204. }
  205.  
  206. // holed donuts
  207. #declare Count = 5
  208. #while (Count > 0)
  209. object
  210. {
  211.   DonutHoleShape
  212.   texture { DonutTexture }
  213.   translate +Count*Spacing*x
  214.   translate MyClock*Spacing*x/2
  215. }
  216. #declare Count = Count-1
  217. #end
  218.  
  219.  
  220. // ----------------------------------------
  221. // Secondary Donuts (right angles)
  222. // ----------------------------------------
  223.  
  224. // holed donuts
  225. #declare Count = 50
  226. #while (Count > 0)
  227. object
  228. {
  229.   DonutHoleShape
  230.   texture { DonutTexture }
  231.   translate <-20, -5, -30 - MyClock*Spacing*2 + Count*Spacing*2>
  232.   rotate 20*y // angle across view a little more
  233. }
  234. #declare Count = Count-1
  235. #end
  236.  
  237.  
  238. // ----------------------------------------
  239. // Tertiary Donuts (in back)
  240. // ----------------------------------------
  241.  
  242. // holed donuts
  243. #declare Count = 50
  244. #while (Count > 0)
  245. object
  246. {
  247.   DonutHoleShape
  248.   texture { DonutTexture }
  249.   translate <30 - MyClock*Spacing*2 - Count*Spacing*2, -10, 40>
  250. }
  251. #declare Count = Count-1
  252. #end
  253.  
  254.  
  255.